home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / mntlb20 / lib / sysvar.c < prev    next >
C/C++ Source or Header  |  1992-02-11  |  514b  |  30 lines

  1. #include <osbind.h>
  2.  
  3. long
  4. get_sysvar(var)
  5.     void *var;
  6. {
  7.     long ret;
  8.     long save_ssp;
  9.     
  10.     save_ssp = Super(0L);
  11.     /* note: dont remove volatile, otherwise gcc will reorder these
  12.        statements and we get bombs
  13.      */
  14.     ret = *((volatile long *)var);
  15.     (void)Super(save_ssp);
  16.     return ret;
  17. }
  18.  
  19. void
  20. set_sysvar_to_long(var, val)
  21.     void *var;
  22.     long val;
  23. {
  24.     long save_ssp;
  25.     
  26.     save_ssp = Super(0L);
  27.     *((volatile long *)var) = val;
  28.     (void)Super(save_ssp);
  29. }
  30.